/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thienloc.omap.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author GiangLT
 */
@Entity
@Table(name = "SYNTAX_DEFINITION", catalog = "", schema = "THIENLOC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SyntaxDefinition.findAll", query = "SELECT s FROM SyntaxDefinition s"),
    @NamedQuery(name = "SyntaxDefinition.findById", query = "SELECT s FROM SyntaxDefinition s WHERE s.id = :id"),
    @NamedQuery(name = "SyntaxDefinition.findBySyntax", query = "SELECT s FROM SyntaxDefinition s WHERE s.syntax = :syntax"),
    @NamedQuery(name = "SyntaxDefinition.findAllSyntax", query = "SELECT DISTINCT s.syntax FROM SyntaxDefinition s"),
    @NamedQuery(name = "SyntaxDefinition.findByServiceName", query = "SELECT s FROM SyntaxDefinition s WHERE s.serviceName = :serviceName"),
    @NamedQuery(name = "SyntaxDefinition.findByUsername", query = "SELECT s FROM SyntaxDefinition s WHERE s.username = :username"),
    @NamedQuery(name = "SyntaxDefinition.findAllUsername", query = "SELECT DISTINCT s.username FROM SyntaxDefinition s"),
    @NamedQuery(name = "SyntaxDefinition.findSyntaxesByUsername", query = "SELECT DISTINCT s.syntax FROM SyntaxDefinition s WHERE s.username = :username"),
    @NamedQuery(name = "SyntaxDefinition.findByMdnSuffixStartRange", query = "SELECT s FROM SyntaxDefinition s WHERE s.mdnSuffixStartRange = :mdnSuffixStartRange"),
    @NamedQuery(name = "SyntaxDefinition.findByMdnSuffixEndRange", query = "SELECT s FROM SyntaxDefinition s WHERE s.mdnSuffixEndRange = :mdnSuffixEndRange")})
public class SyntaxDefinition implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID")
    private BigDecimal id;
    @Size(max = 50)
    @Column(name = "SYNTAX")
    private String syntax;
    @Size(max = 50)
    @Column(name = "SERVICE_NAME")
    private String serviceName;
    @Size(max = 50)
    @Column(name = "USERNAME")
    private String username;
    @Column(name = "MDN_SUFFIX_START_RANGE")
    private Integer mdnSuffixStartRange;
    @Column(name = "MDN_SUFFIX_END_RANGE")
    private Integer mdnSuffixEndRange;

    public SyntaxDefinition() {
    }

    public SyntaxDefinition(BigDecimal id) {
        this.id = id;
    }

    public BigDecimal getId() {
        return id;
    }

    public void setId(BigDecimal id) {
        this.id = id;
    }

    public String getSyntax() {
        return syntax;
    }

    public void setSyntax(String syntax) {
        this.syntax = syntax;
    }

    public String getServiceName() {
        return serviceName;
    }

    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getMdnSuffixStartRange() {
        return mdnSuffixStartRange;
    }

    public void setMdnSuffixStartRange(Integer mdnSuffixStartRange) {
        this.mdnSuffixStartRange = mdnSuffixStartRange;
    }

    public Integer getMdnSuffixEndRange() {
        return mdnSuffixEndRange;
    }

    public void setMdnSuffixEndRange(Integer mdnSuffixEndRange) {
        this.mdnSuffixEndRange = mdnSuffixEndRange;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SyntaxDefinition)) {
            return false;
        }
        SyntaxDefinition other = (SyntaxDefinition) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.thienloc.omap.entity.SyntaxDefinition[ id=" + id + " ]";
    }
    
}
